/**
moremodtypesV4 by sby

added tweak to fix panties chest not visible on load
in works of adding extra tops layer


//---------------------
moremodtypesV3 by sby

this mod registers additional modtypes with sdt.
uses a proxy to set the armwear properly
tweaked armwear so rgb things work on hands

**/


package flash
{
	import flash.display.DisplayObject;
	import flash.geom.ColorTransform;
	import flash.filters.ColorMatrixFilter;
	import flash.display.Sprite;
	import flash.display.MovieClip;
    public dynamic class Main extends flash.display.MovieClip
    {
		
		var main;
		var g;
		var CharacterControl:Class;
		var CustomElementHelper:Class;
		var ModTypes:Class;
		var ModElements:Class;
		public var dynamicoverextendedlayer:Sprite = new Sprite();
		public var armupdates:Array = new Array();
		
		public var rightBreastm:MovieClip = new MovieClip();		
		public var chestm:MovieClip = new MovieClip(); 
		public var backm:MovieClip = new MovieClip(); 
		public var strapm:MovieClip = new MovieClip(); 
		public var leftBreastm:MovieClip = new MovieClip(); 
		public var underm:MovieClip = new MovieClip(); 
		public var rightArmm:MovieClip = new MovieClip(); 
		public var leftArmm:MovieClip = new MovieClip(); 
		
		public var overTopControl;
		
		
		public function initl(l){
			
			
			main = l;
			g = l.g;
			
			l.TemplateExtension = this;
			
			CharacterControl = main.eDOM.getDefinition("obj.CharacterControl") as Class;
			//loadedmod = main.eDOM.getDefinition("obj.LoadedMod") as Class;
			//loadedmodpackage = main.eDOM.getDefinition("obj.LoadedModPackage") as Class;
			//CharacterElementHelper = main.eDOM.getDefinition("obj.CharacterElementHelper") as Class;
			//CostumeElement = main.eDOM.getDefinition("obj.CostumeElement") as Class;
			//LoadedMod = main.eDOM.getDefinition("obj.LoadedMod") as Class;
			//LoadedModPackage = main.eDOM.getDefinition("obj.LoadedModPackage") as Class;
			
			var lProxy:Class = main.lDOM.getDefinition("Modules.lProxy");

			ModTypes = main.eDOM.getDefinition("SDTMods.ModTypes") as Class;
			ModElements = main.eDOM.getDefinition("SDTMods.ModElements") as Class;
			CustomElementHelper = main.eDOM.getDefinition("obj.CustomElementHelper") as Class;
			
			ModTypes.CUFFS = "CostumeCuffs";				//defining new modtype for sdt to know about
			g.customElementLoader.modTargetHelpers[ModTypes.CUFFS] = new CustomElementHelper(
			{
			leftcuff:g.her.leftArmContainer.upperArmCostume.foreArmCostume.cuff,
			behindback:g.her.torso.cuffs,
			rightcuff:g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.cuff}, g.characterControl.cuffsControl);
				
				
			ModTypes.ANKLECUFFS = "CostumeAnkleCuffs";
			g.customElementLoader.modTargetHelpers[ModTypes.ANKLECUFFS] = new CustomElementHelper(
			{
			leftanklecuff:g.her.leftLegContainer.leg.cuffs,
			rightanklecuff:g.her.torso.rightCalfContainer.cuffs}, g.characterControl.ankleCuffsControl);
				
				
			ModTypes.LEGWEAR = "CostumeLegwear";
			g.customElementLoader.modTargetHelpers[ModTypes.LEGWEAR] = new CustomElementHelper(
			{
			rightThigh:g.her.torso.rightThighStocking.stocking, 
			rightCalf:g.her.torso.rightCalfContainer.calfStocking, 
			leftThigh:g.her.leftLegContainer.leg.stocking, 
			leftCalf:g.her.leftLegContainer.leg.calfStocking, 
			backside:g.her.torsoBackCostume.backsideCostume.stocking}, g.characterControl.legwearControl);

			
			ModTypes.LEGWEARB = "CostumeLegwearB";
			g.customElementLoader.modTargetHelpers[ModTypes.LEGWEARB] = new CustomElementHelper(
			{
			rightThighB:g.her.torso.rightThighStockingB.stocking, 
			rightCalfB:g.her.torso.rightCalfContainer.calfStockingB, 
			leftThighB:g.her.leftLegContainer.leg.stockingB, 
			leftCalfB:g.her.leftLegContainer.leg.calfStockingB, 
			backsideB:g.her.torsoBackCostume.backsideCostume.stockingB}, g.characterControl.legwearBControl);

			
			ModTypes.ARMWEAR = "CostumeArmwear";
			g.customElementLoader.modTargetHelpers[ModTypes.ARMWEAR] = new CustomElementHelper({
				leftglove:g.her.torso.leftGlove, //left hand behind back
				rightglove:g.her.torso.rightGlove, //right forearm behind back (small area goes over forearm)
				
				rightlowerarmwear:g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.glove, 
				leftlowerarmwear:g.her.leftArmContainer.upperArmCostume.foreArmCostume.glove, 
				
				righthandglove:g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume, 
				lefthandglove:g.her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume, 
				
				rightupperarmwear:g.her.rightArmContainer.upperArmCostume.glove, 
				leftupperarmwear:g.her.leftArmContainer.upperArmCostume.glove,
				
				//fingerr:g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove.grip,
					//grip:g.her.rightForeArmContainer.upperArm.foreArm.hand.grip,
							
				handoverglove:g.her.leftHandOver.hand.glove	//left fingers
			}, g.characterControl.armwearControl);

			
			ModTypes.PANTIES = "CostumePanties";
			g.customElementLoader.modTargetHelpers[ModTypes.PANTIES] = new CustomElementHelper(
			{
			rightThigh:g.her.torso.rightThighCostume.panties, 
			leftThigh:g.her.leftLegContainer.leg.leftThighCostume.panties, 
			back:g.her.torso.backUnderCostume.panties, 
			chest:g.her.torso.chestUnderCostume.panties, 
			backside:g.her.torsoBackCostume.backsideCostume.panties}, g.characterControl.pantiesControl);
			
			
			//ModTypes.BRA = "CostumeBra";
			g.customElementLoader.modTargetHelpers[ModTypes.BRA] = new CustomElementHelper(
			{
			rightBreast:g.her.torso.breastCostume.bra, 
			back:g.her.torso.braStrap, 
			under:g.her.torso.shoulderStrap, 
			chest:g.her.torso.upperChestCostume.bra, 
			leftBreast:g.her.torsoBackCostume.breastCostume.bra} , g.characterControl.braControl);
						
			
			
			ModTypes.OVERTOP = "CostumeOverTop";

			
			g.her.leftArmContainer.upperArmCostume.top.parent.addChild(leftArmm);
			leftArmm.transform.matrix = g.her.leftArmContainer.upperArmCostume.top.transform.matrix;
			//leftArmm.x = g.her.leftArmContainer.upperArmCostume.top.x;
			//leftArmm.y = g.her.leftArmContainer.upperArmCostume.top.y;
			//leftArmm.rotation = g.her.leftArmContainer.upperArmCostume.top.rotation;
			
			
			
			
			//g.her.torsoBackCostume.breastCostume.bra.parent.addChild(leftBreastm);
			//leftBreastm.transform.matrix = g.her.torsoBackCostume.breastCostume.bra.transform.matrix;
			g.her.torsoBackCostume.breastCostume.top.parent.addChild(leftBreastm);
			leftBreastm.transform.matrix = g.her.torsoBackCostume.breastCostume.top.transform.matrix;
			//g.her.torsoBackCostume.breastCostume.top.parent.addChildAt(leftBreastm,g.her.torsoBackCostume.breastCostume.top.parent.getChildIndex(g.her.torsoBackCostume.breastCostume.top));
			
			//leftBreastm.x = g.her.torsoBackCostume.breastCostume.top.x;
			//leftBreastm.y = g.her.torsoBackCostume.breastCostume.top.y; 
			//leftBreastm.rotation = g.her.torsoBackCostume.breastCostume.top.rotation; 
			
			 
			
			g.her.torso.topContainer.topStrap.parent.addChild(strapm);
			strapm.transform.matrix = g.her.torso.topContainer.topStrap.transform.matrix;
			//strapm.x = g.her.torso.topContainer.topStrap.x;
			//strapm.y = g.her.torso.topContainer.topStrap.y; 
			//strapm.rotation = g.her.torso.topContainer.topStrap.rotation; 
			
			
			
			//g.her.torsoUnderCostume.top.parent.addChildAt(underm,g.her.torsoUnderCostume.top.parent.getChildIndex(g.her.torsoUnderCostume.top));
			g.her.torsoUnderCostume.top.parent.addChild(underm);
			underm.transform.matrix = g.her.torsoUnderCostume.top.transform.matrix;
			//underm.x = g.her.torsoUnderCostume.top.x;
			//underm.y = g.her.torsoUnderCostume.top.y; 
			//underm.rotation = g.her.torsoUnderCostume.top.rotation; 
			
			
			
			
			g.her.torso.topContainer.chestTop.parent.addChild(chestm);
			chestm.transform.matrix = g.her.torso.topContainer.chestTop.transform.matrix;
			//chestm.x = g.her.torso.topContainer.chestTop.x;
			//chestm.y = g.her.torso.topContainer.chestTop.y; 
			//chestm.rotation = g.her.torso.topContainer.chestTop.rotation;
			
			
			g.her.torso.topContainer.backTop.parent.addChild(backm);
			backm.transform.matrix = g.her.torso.topContainer.backTop.transform.matrix;
			//backm.x = g.her.torso.topContainer.backTop.x;
			//backm.y = g.her.torso.topContainer.backTop.y;	
			//backm.rotation = g.her.torso.topContainer.backTop.rotation;
			
			
			
			
			//g.her.torso.breastCostume.bra.parent.addChild(rightBreastm);
			//rightBreastm.transform.matrix = g.her.torso.breastCostume.bra.transform.matrix;
			
			g.her.torso.topContainer.breastTop.parent.addChild(rightBreastm);		//seems to work
			rightBreastm.transform.matrix = g.her.torso.topContainer.breastTop.transform.matrix;
			//g.her.torso.topContainer.breastTop.parent.addChildAt(rightBreastm,g.her.torso.topContainer.breastTop.parent.getChildIndex(g.her.torso.topContainer.breastTop));
			//rightBreastm.x = g.her.torso.topContainer.breastTop.x;
			//rightBreastm.y = g.her.torso.topContainer.breastTop.y; 
			//rightBreastm.rotation = g.her.torso.topContainer.breastTop.rotation;
			
			
			g.her.rightArmContainer.upperArmCostume.top.parent.addChild(rightArmm);
			rightArmm.transform.matrix = g.her.rightArmContainer.upperArmCostume.top.transform.matrix;
			//rightArmm.x = g.her.rightArmContainer.upperArmCostume.top.x;
			//rightArmm.y = g.her.rightArmContainer.upperArmCostume.top.y; 
			//rightArmm.rotation = g.her.rightArmContainer.upperArmCostume.top.rotation; 
			
			overTopControl = new CharacterElementHelper(this.topNameList, this.setTopm, this.setTopFillm);
			overTopControl.registerComponents([rightBreastm, chestm, backm, strapm, leftBreastm, underm, rightArmm, leftArmm], ModTypes.OVERTOP);

			
			
			
			g.customElementLoader.modTargetHelpers[ModTypes.OVERTOP] = new CustomElementHelper(
			{
			rightBreast:rightBreastm, 
			chest:chestm, 
			back:backm, 
			strap:strapm, 
			leftBreast:leftBreastm, 
			under:underm, 
			rightArm:rightArmm, 
			leftArm:leftArmm} , overTopControl);
			
						
			//var lp3 = lProxy.createProxy(g.her, "updateArms");			
			//lp3.addPre(updateHandJobMode,true);	
            //lp3.hooked = true;

			
			//var lp3 = lProxy.createProxy(g.her, "setRightArmPosition");			
			//lp3.addPost(armupdate,true);	
            //lp3.hooked = true;

			//var lp5 = lProxy.createProxy(g.her, "setLeftArmPosition");			
			//lp5.addPost(armupdate,true);	
            //lp5.hooked = true;
			
			
			//ModElements["dynamicHairOverExtended"] = DYNAMIC_HAIR_OVER_Extended;		//fields, not a dic
			//g.hairOverLayer  //original target
			//g.frontLayer.parent.addChildAt(dynamicoverextendedlayer, g.frontLayer.parent.getChildIndex(g.frontLayer) + 1);
			//g.frontLayer.addChild(dynamicoverextendedlayer);		//above strands
			g.frontLayer.addChildAt(dynamicoverextendedlayer, g.frontLayer.getChildIndex(g.himOverLayer) - 1);   //just in case
			//g.container.addChild(dynamicoverextendedlayer);	//doesn't follow
			//g.sceneLayer.addChild(dynamicoverextendedlayer);   //not high enough
			g.customElementLoader.modTargetHelpers["dynamicHairOverExtended"] = new CustomElementHelper({target:dynamicoverextendedlayer});
			
			
			var lp4 = lProxy.createProxy(g.her, "updateHandJobMode");	//does not need colortransform		
			lp4.addPost(updateHandJobMode,true);	
            lp4.hooked = true;
			
			g.characterControl.armwearControl.fillFunction = setArmwearFill;
			
			
			var lp5 = lProxy.createProxy(g.customElementLoader, "addStaticModElement");	
			lp5.addPre(addStaticModElement,true);	
            lp5.hooked = false;
			
			//stuff for extra layer top
			var lp6 = lProxy.createProxy(g.characterControl, "setBreastCostumeSize");	
			lp6.addPost(setBreastCostumeSizem,true);	
            lp6.hooked = true;
			
			
			//removed when swapped to ovetop controller
			/*var lp7 = lProxy.createProxy(g.characterControl, "setTop");	
			lp7.addPost(setTopm,true);	
            lp7.hooked = true;
			
			var lp8 = lProxy.createProxy(g.characterControl, "setTopFill");	
			lp8.addPre(setTopFillm,true);	
            lp8.hooked = true;
			//g.characterControl.topControl.fillFunction = g.characterControl.setTopFill;*/
			
			
			
			//var lp9 = lProxy.createProxy(g.her.leftBreastController, "update");	
			//lp9.addPost(lupdate,true);	
            //lp9.hooked = true; 
			
			
			var lp10 = lProxy.createProxy(g.her.rightBreastController, "update");	
			lp10.addPost(rupdate,true);	
            lp10.hooked = true;
			
			var lp11 = lProxy.createProxy(g.her, "updateBreathingScaledElements");	
			lp11.addPost(bupdate,true);	
            lp11.hooked = true;
			//stuff for extra layer top
			
			//main.updateStatusCol("")
			main.unloadMod();
			return;
			
		}
		
		/*
		function lupdate()
		{
			leftBreastm.transform.matrix = g.her.leftBreastController._breastMatrix;		//somehow this makes it not work
			//leftBreastm.visible = !leftBreastm.visible; 
		}*/
		
		function rupdate()
		{
			rightBreastm.transform.matrix = g.her.rightBreastController._breastMatrix;
		}
		
		function bupdate()
		{
		
		//underm.transform.matrix = g.her.torsoUnderCostume.transform.matrix;
		//underm.y -= 10;
		//underm.rotation += 30;
		chestm.transform.matrix = g.her.torso.chestUnderCostume.transform.matrix;
		}
		
		
		function addStaticModElement(param1) : void
        {
            var _loc_3:* = null;
            var _loc_4:* = false;
            var _loc_2:* = g.customElementLoader.modTargetHelpers[param1.targetElement || param1.modType];
            if (_loc_2.hasCostumeHelper)
            {
                _loc_2.characterElementHelper.prepForMod(g.customElementLoader.loadingModPackage.titleString, param1.overwrite);
            }
            if (_loc_2.singleElement)
            {
                _loc_3 = _loc_2.targetDictionary["target"];
                if (param1.overwrite)
                {
                    if (param1.targetElement == ModElements.HAIR_TOP || param1.targetElement == ModElements.HAIR_UNDER || param1.targetElement == ModElements.HAIR_BOTTOM || param1.targetElement == ModElements.HAIR_BACK)
                    {
                        g.characterControl.clearHair();
                    }
                    else
                    {
                        _loc_3.gotoAndStop("None");
                    }
                }
                g.customElementLoader.addModToTarget(param1, _loc_3);
            }
            else
            {
                _loc_4 = false;
                if (param1.modType == ModTypes.BODY)
                {
                    _loc_4 = param1.overwrite;
                }
                g.customElementLoader.placeElements(param1, _loc_2.targetDictionary, _loc_4);
                if (param1.modType == ModTypes.TOP || param1.modType == ModTypes.BRA || param1.modType == ModTypes.OVERTOP)
                {
                    g.characterControl.setBreastCostumeSize();
                }
				else if (param1.modType == ModTypes.PANTIES)
                {
                    //main.updateStatus("testhere2");
					//g.her._penisControl.updatePenis();
					//g.her._penisControl.penisControl.select(0);
					//g.her._penisControl.clothingChanged();
					//g.characterControl.setPanties(1);  //uses seelction, not arg
					g.her.torso.chestUnderCostume.panties.gotoAndStop(g.characterControl.pantiesNameList[1]);
					g.her.torso.chestUnderCostume.panties.gotoAndStop(g.characterControl.pantiesNameList[0]);
					//g.characterControl.pantiesControl.select(0);
					//g.characterControl.pantiesControl.showAll();
					//g.customElementLoader.clearModTypes([ModTypes.PANTIES]);
					//g.characterControl.setPanties(0);
                }
                else if (param1.modType == ModTypes.BODY)
                {
                    g.characterControl.prepForBodyMod();
                }
            }
            if (_loc_2.hasCostumeHelper)
            {
                _loc_2.characterElementHelper.resetFills();
            }
            return;
        }// end function
		
		
		
		
		
		function setArmwearFill(param1:Object, param2:String = "rgbFill") : void
        {
            updateHandJobMode();
			var _loc_3:* = new ColorTransform(1, 1, 1, param1.a, param1.r, param1.g, param1.b);
            CharacterControl.tryToSetFill(g.her.torso.leftGlove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.torso.rightGlove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.glove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.leftArmContainer.upperArmCostume.foreArmCostume.glove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume.glove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.rightArmContainer.upperArmCostume.glove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.leftArmContainer.upperArmCostume.glove, param2, _loc_3);
            CharacterControl.tryToSetFill(g.her.leftHandOver.hand.glove, param2, _loc_3);
			CharacterControl.tryToSetFill(g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume, param2, _loc_3);
			CharacterControl.tryToSetFill(g.her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume, param2, _loc_3);
            return;
        }// end function*/
		
		
		
		function updateHandJobMode() : void
        {
			var a = new Array();
			for each( var thing in g.customElementLoader.instancedModElements)
			{
				if(thing._modType == ModTypes.ARMWEAR)
				{
					//main.updateStatus("found mod");
					a.push(thing._mod);
				}
			}
			updatemyarmwear(a);
			for(var i:int = 0; i < armupdates.length; i++) {armupdates[i]();}
            return;
        }
		
		
		function updatemyarmwear(thing)
		{
			//main.updateStatus("hey");
			//main.updateStatus("1"+thing);
			for each(var id in thing) 
			{
			   //main.updateStatus(id.name);
			  
			 
			  if(id.name == "righthandglove")
			  {
				//main.updateStatus(id.name);
				tryToSetFrameLabel(id, g.rightHandJobMode ? ("Grip") : ("Free"));
				
					
					for each(var a in id)
					{
						if(a is DisplayObject)
						{
							//main.updateStatus("is display");
							if(a.hasOwnProperty("name"))
							{
								//main.updateStatus(a.name);
								if(a.name == "grip")
								{
									//main.updateStatus(a);
									var targett = null;
									
									if (g.her.rightForeArmContainer.upperArm.foreArm.hand.grip)
									{
										targett = g.her.rightForeArmContainer.upperArm.foreArm.hand.grip;
									}
									else
									{
										if (g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove.grip)
										{
											targett = g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove.grip;
										}
										else
										{
											if (g.her.rightForeArmContainer.upperArm.foreArm.hand.tan.grip)
											{
												targett = g.her.rightForeArmContainer.upperArm.foreArm.hand.tan.grip;
											}
											else
											{
												if (g.her.leftHandOver.hand.grip)
												{
													targett = g.her.leftHandOver.hand;
												}
											}
										}
									}
									
									
									if(targett != null)
									{
									//main.updateStatus(id.getChildAt(0).name);
									a.scaleY = targett.scaleY;
									a.x = targett.x
									//main.updateStatus(main.her.rightForeArmContainer.upperArm.foreArm.hand.grip.x+" "+main.her.rightForeArmContainer.upperArm.foreArm.hand.grip.y);						
									a.y = targett.y;
									a.rotation = targett.rotation;
									}
									else
									{
									//main.updateStatus("targ null");
									}
								}
							}
						}
					}
					
				
				
				
			  }
			  
			  if(id.name == "lefthandglove")
			  {
				//main.updateStatus(id.name);
				tryToSetFrameLabel(id, g.leftHandJobMode ? ("Grip") : ("Free"));
			  }
			  
				
				if(id.name == "rightupperarmwear")
				{
				//main.updateStatus("fixed right");
				tryToSetFrameLabel(id, g.her.isRightArmFree() ? ("Free") : ("back"));
				}
				if(id.name == "leftupperarmwear")
				{
				//main.updateStatus("fixed left");
				tryToSetFrameLabel(id, g.her.isLeftArmFree() ? ("Free") : ("back"));
				}
				
		  
			}
			//main.updateStatus("ho");
			
		}
		
		public function setTopFillm(param1:Object, param2:String = "rgbFill") : void
        {
			//main.updateStatus("set top fill ran");
			//g.characterControl.setTopFill(param1, param2);
            var _loc_3:* = new ColorTransform(1, 1, 1, param1.a, param1.r, param1.g, param1.b);
            var _loc_4:* = new ColorTransform(1, 1, 1, 1, param1.r, param1.g, param1.b);
            var _loc_5:* = new ColorMatrixFilter([1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, param1.a, 0]);
            //g.her.torso.topContainer.filters = [_loc_5];
            //g.her.torsoBackCostume.breastCostume.top.filters = [_loc_5];
            CharacterControl.tryToSetFill(rightBreastm, param2, _loc_4);
            CharacterControl.tryToSetFill(chestm, param2, _loc_4);
            CharacterControl.tryToSetFill(backm, param2, _loc_4);
            CharacterControl.tryToSetFill(strapm, param2, _loc_4);
            CharacterControl.tryToSetFill(leftBreastm, param2, _loc_3);
            CharacterControl.tryToSetFill(underm, param2, _loc_3);
            CharacterControl.tryToSetFill(rightArmm, param2, _loc_3);
            CharacterControl.tryToSetFill(leftArmm, param2, _loc_3);
            var _loc_6:* = new ColorTransform(1, 1, 1, 1, param1.r * 1/2, param1.g * 1/2, param1.b * 1/2);
            CharacterControl.tryToSetFill(rightBreastm, "outline", _loc_6);
            CharacterControl.tryToSetFill(leftBreastm, "outline", _loc_6);
            return;
        }
		
		public function setTopm(param1:uint) : void
        {
            //main.updateStatus("set top m ran");
			CharacterControl.tryToSetFrameLabel(rightBreastm, overTopControl.selectedName);
            CharacterControl.tryToSetFrameLabel(chestm, overTopControl.selectedName);
            CharacterControl.tryToSetFrameLabel(backm, overTopControl.selectedName);
            CharacterControl.tryToSetFrameLabel(strapm, overTopControl.selectedName);
            CharacterControl.tryToSetFrameLabel(leftBreastm, overTopControl.selectedName);
            CharacterControl.tryToSetFrameLabel(underm, overTopControl.selectedName);
            var _loc_2:* = overTopControl.selectedName + (g.her.isLeftArmFree() ? ("Free") : (""));
            var _loc_3:* = overTopControl.selectedName + (g.her.isRightArmFree() ? ("Free") : (""));
            CharacterControl.tryToSetFrameLabel(rightArmm, _loc_3);
			//may not need this one
            CharacterControl.tryToSetFrameLabel(g.her.rightArmEraseContainer.upperArmCostume.top, _loc_3);
			//here
            CharacterControl.tryToSetFrameLabel(leftArmm, _loc_2);
            g.characterControl.setBreastCostumeSize();
            return;
			
			
			
			/*
			//main.updateStatus("set top m ran");
			CharacterControl.tryToSetFrameLabel(rightBreastm, g.characterControl.topControl.selectedName);
            CharacterControl.tryToSetFrameLabel(chestm, g.characterControl.topControl.selectedName);
            CharacterControl.tryToSetFrameLabel(backm, g.characterControl.topControl.selectedName);
            CharacterControl.tryToSetFrameLabel(strapm, g.characterControl.topControl.selectedName);
            CharacterControl.tryToSetFrameLabel(leftBreastm, g.characterControl.topControl.selectedName);
            CharacterControl.tryToSetFrameLabel(underm, g.characterControl.topControl.selectedName);
            var _loc_2:* = g.characterControl.topControl.selectedName + (g.her.isLeftArmFree() ? ("Free") : (""));
            var _loc_3:* = g.characterControl.topControl.selectedName + (g.her.isRightArmFree() ? ("Free") : (""));
            CharacterControl.tryToSetFrameLabel(rightArmm, _loc_3);
			//may not need this one
            CharacterControl.tryToSetFrameLabel(g.her.rightArmEraseContainer.upperArmCostume.top, _loc_3);
			//here
            CharacterControl.tryToSetFrameLabel(leftArmm, _loc_2);
            g.characterControl.setBreastCostumeSize();
            return;*/
        }
		
		public function setBreastCostumeSizem() : void
        {
			//main.updateStatus("b column size");
            g.characterControl.setChildrenFrame(rightBreastm, 2 + g.characterControl.breastSize);
            g.characterControl.setChildrenFrame(chestm, 2 + g.characterControl.breastSize);
            g.characterControl.setChildrenFrame(leftBreastm, 2 + g.characterControl.breastSize);
            return;
        }
		
		
			
			/*
		function armupdate()
		{
		
			updateHandJobMode();
			if(g.characterControl.armwearControl.haveRGBFill)
			{
				var param1 = g.characterControl.armwearControl.rgb1;
				//this.rgb1["r"] + "," + this.rgb1["g"] + "," + this.rgb1["b"] + "," + g.sigRound(3, this.rgb1["a"]))
				var _loc_3:* = new ColorTransform(1, 1, 1, param1.a, param1.r, param1.g, param1.b);
				var param2:String = "rgbFill"
				//CharacterControl.tryToSetFill(g.her.torso.leftGlove, param2, _loc_3);
				//CharacterControl.tryToSetFill(g.her.torso.rightGlove, param2, _loc_3);
				//CharacterControl.tryToSetFill(g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.glove, param2, _loc_3);
				//CharacterControl.tryToSetFill(g.her.leftArmContainer.upperArmCostume.foreArmCostume.glove, param2, _loc_3);
				CharacterControl.tryToSetFill(g.her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume, param2, _loc_3);
				CharacterControl.tryToSetFill(g.her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume, param2, _loc_3);
				CharacterControl.tryToSetFill(g.her.rightArmContainer.upperArmCostume.glove, param2, _loc_3);
				CharacterControl.tryToSetFill(g.her.leftArmContainer.upperArmCostume.glove, param2, _loc_3);
				//CharacterControl.tryToSetFill(g.her.leftHandOver.hand.glove, param2, _loc_3);
				

			}
		
		
		}*/
		public function tryToSetFrameLabel(param1:MovieClip, param2:String) : void
        {
            var _loc_3:* = null;
            var _loc_4:* = null;
			try
			{
				if (param1)
				{
					_loc_3 = param1.currentLabels;
					for each (_loc_4 in _loc_3)
					{
						
						if (_loc_4.name == param2)
						{
							param1.gotoAndStop(param2);
							return;
						}
					}
					param1.gotoAndStop("None");
				}
			}catch(e){}
            return;
        }
		
	}
}

